package com.neu.api.mapper;

import com.neu.api.pojo.Category;
import com.neu.api.query.CategoryQuery;
import com.neu.api.vo.CategoryVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CategoryMapper {
    //mybatis
       //注解
       //映射文件

    //@Select("select id,name from t_category ")
    public List<CategoryVO> find();

    public void add(Category category);

    /**
     * 菜品查询
     * @param categoryQuery
     * @return
     */
    List<CategoryVO> find(CategoryQuery categoryQuery);

    /**
     * 编辑菜品
     * @param category
     */
    void update(Category category);

    /**
     * 删除菜品，根据id
     */
    @Delete("delete from t_category where id = #{id}")
    void deleteById(long id);
}